package com.longdaji.decoration.utils;

import android.util.Log;

import com.longdaji.decoration.bean.Topic;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Kanade on 2018/3/13 0013.
 */

public class SearchUtil {
    private static final String TAG = "SearchUtil";

    public static List<Topic> searchTopic(String str, List<Topic> allTopics) {
        List<Topic> topicList = new ArrayList<>();
        if (allTopics == null || allTopics.size() == 0) {
            return topicList;
        }
        for (Topic topic : allTopics) {
            Log.d(TAG, "allTopics : " + allTopics.size());
            if (topic.getTopic() != null && topic.getTopic().contains(str)) {
                topicList.add(topic);
            }
        }
        return topicList;
    }
}
